<%@ page language="java" pageEncoding="UTF-8"%>  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>  
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ include file="../header.jsp"%>
<jsp:include page="../js.jsp"/>
<div class="content-wrapper" style="font-family: '微软雅黑';">
<input type="hidden" id="ctx" value="<%=request.getContextPath()%>"/>
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      ${module } <small>Control panel</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href=""><i class="fa fa-dashboard"></i>主页</a></li>
      <li class="active">版本编辑</li>
    </ol>
  </section>
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
          <div>  
    <div>
        版本号： 
        <input type="text" id="version_code" value="${version.version_code}"/>
        <input type="hidden" id="version_id" value="${version.version_id}"/>
    </div>
    <div>
        描述： <textarea rows="5" cols="100" id="description">${version.description}</textarea>
    </div>
    <div>
        下载链接： <textarea rows="5" cols="100" id="url">${version.url}</textarea>
    </div>
    <div>
        类型： <select id="type">  
  <option value ="1" <c:if test="${version.type==1}">selected="selected"</c:if>>雇主</option>  
  <option value ="2"  <c:if test="${version.type==2}">selected="selected"</c:if>>经纪人</option>  
</select> 
        <input type="button" onclick="updateRecord()"  value="保存">  
    </div>
    </div>  
          </div>
          <!-- /.box-header -->
          <div class="box-body">

    </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
    <!--  显示下面的分页控件  -->
  </section>
  <!-- /.content -->
</div>
<script type="text/javascript">
function updateRecord(){
	var version_id=$('#version_id').val();
	var version_code=$('#version_code').val();
	var description=$('#description').val();
	var url=$('#url').val();
	var type=$('#type').val();
	if(version_id==null||version_id.trim()==''){
		return;
	}
	if(version_code==null||version_code.trim()==''){
		alert("版本号不能为空");
		return;
	}
	if(description==null||description.trim()==''){
		alert("描述不能为空");
		return;
	}
	if(url==null||url.trim()==''){
		alert("下载地址不能为空");
		return;
	}
	if(type==null||type.trim()==''){
		alert("类型不能为空");
		return;
	}
	
	
	
	window.location.href=$("#ctx").val()+"/version/edit?version_id="+version_id
			+"&version_code="+version_code
			+"&description="+description
			+"&url="+url
			+"&type="+type
			;
	
}

</script>

<%@ include file="../footer.jsp"%>





